package cn.javass.dp.observer.example2;

public class Reader implements  Observer {
    /**
     * 读者的姓名
     */
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void update(Subject subject) {
        System.out.println(
                "name = " + name + "s收到报纸了， 报纸的内容是" +
                ((NewPaper)subject).getContent());

    }
}
